home *** CD-ROM | disk | FTP | other *** search
- #!/bin/vtcl
- # ---------------------------------------------------------------------
- # Copyright 1994 by SCO, Inc.
- # Permission to use, copy, modify, distribute, and sell this software
- # and its documentation for any purpose is hereby granted without fee,
- # provided that the above copyright notice appear in all copies and that
- # both that copyright notice and this permission notice appear in
- # supporting documentation, and that the name of SCO not be used in
- # advertising or publicity pertaining to distribution of the software
- # without specific, written prior permission. SCO makes no
- # representations about the suitability of this software for any
- # purpose. It is provided "as is" without express or implied warranty.
- # ---------------------------------------------------------------------
-
- # Demo : frame.tcl
- # Description : Demo of features of the Frame widget, including shadow
- # types.
- #
- # Note : Frame widget in Character Motif only displays a solid
- # border. Also, there is no Title support.
-
- # Close connection and exit Vtcl interpreter.
- proc CloseCB { cbs } {
- VtClose; exit 0
- }
-
- proc ChangeFrameCB {frame type cbs} {
- if { [VtInfo -charm] == 1 } {
- set mainF [keylget cbs dialog]
- VtShow [VtInformationDialog $mainF.Info \
- -message "In Charm Mode... \n1. A Frame simply puts a box around a widget.\n2. Title is not supported." \
- -ok \
- ]
- }
- VtSetValues $frame \
- -shadowType $type \
- -title $type
- }
-
- proc noTitleCB {frame cbs} {
- VtSetValues $frame \
- -title NONE
- }
-
- #
- # Start Program
- #
- set ap [VtOpen frame]
-
- set mainForm [VtFormDialog $ap.form \
- -title "VtFrame" \
- ]
-
- set frame [VtFrame $mainForm.frame \
- -title "ETCHED_IN" \
- -topSide FORM \
- -leftSide FORM \
- -bottomSide FORM \
- ]
-
- # This puts a row column inside the frame to give
- # it some width.
- set frameRowCol [VtRowColumn $frame.frameRowCol]
-
- # Need to put something in the rowcolumn widget.
- VtLabel $frameRowCol.lab1 -label " "
-
- set buttonRowCol [VtRowColumn $mainForm.buttonRowCol \
- -leftSide NONE \
- -rightSide FORM \
- -topSide FORM\
- ]
-
- foreach type {IN OUT ETCHED_IN ETCHED_OUT} {
- VtPushButton $buttonRowCol.$type \
- -label $type \
- -labelCenter \
- -callback "ChangeFrameCB $frame $type"
- }
-
- VtPushButton $buttonRowCol.none \
- -label "No Title" \
- -labelCenter \
- -callback "noTitleCB $frame"
-
- VtPushButton $buttonRowCol.quit \
- -label QUIT \
- -labelCenter \
- -callback CloseCB
-
- VtSetValues $frame \
- -rightSide $buttonRowCol \
- -rightOffset 30
-
- VtShow $mainForm
-
- VtMainLoop
-
-